package com.example.cadmin.controller;


import com.example.cadmin.service.MotorLogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 电机运行日志 前端控制器
 * </p>
 *
 * @author zzsoft
 * @since 2023-02-22
 */
@Controller
@RequestMapping("/motor/log")
public class MotorLogController {
    @Resource
    private MotorLogService motorLogService;

    /**
     * 电机运行日志
     */
    @GetMapping("/index")
    public String runLog() {
        return "MotorLog/runLog";
    }

    /**
     * 电机运行日志-表格数据
     */
    @GetMapping("list")
    @ResponseBody
    public Map<String, Object> tbaleList(@RequestParam(value = "page") int page,
                                         @RequestParam(value = "limit") int limit,
                                         @RequestParam(value = "type", required = false) String type,
                                         @RequestParam(value = "userName", required = false) String userName, HttpServletRequest request) {
        return motorLogService.tbaleList(page, limit, type, userName, request);

    }

}
